package com.dunqi.gpm.cangxi.home.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseViewHolder;
import com.dunqi.gpm.cangxi.R;
import com.dunqi.gpm.cangxi.common.base.RecyclerAdapter;
import com.dunqi.gpm.cangxi.home.bean.Up;
import com.dunqi.gpm.cangxi.home.widget.NormalView;

import java.util.List;

/**
 * Created by 空 on 2017/12/21 0021.
 */
public class UpAdapter extends RecyclerAdapter<Up> {

    String[] ups = {"", "项目点赞", "进展点赞"};

    public UpAdapter(@Nullable List<Up> data) {
        super(R.layout.item_up, data);
//        1 项目点赞
//        2 进展点赞

    }

    @Override
    protected void convert(BaseViewHolder helper, Up item) {
        String admireUserName = item.getAdmireUserName();
        String admireTime = item.getAdmireTime();
        int admireType = item.getAdmireType();

        NormalView upNicknameView = helper.getView(R.id.up_nickname_view);
        NormalView type_view = helper.getView(R.id.type_view);
        NormalView up_time_view = helper.getView(R.id.up_time_view);
        upNicknameView.setText(admireUserName);
        up_time_view.setText(admireTime);
        type_view.setText(ups[admireType]);

    }
}
